﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;
using System;

public class PropsBase : MonoBehaviour
{
    /// <summary>
    /// 类型
    /// </summary>
    public PropsType type;

    /// <summary>
    /// 效果持续时间
    /// </summary>
    public float time;

    /// <summary>
    /// 道具飞向玩家时间
    /// </summary>
    public float flyTime;


    public Ease ease;


    private void Start()
    {
        
    }


    protected void Fly2Player()
    {

        this.transform.DOMove(GameManager.instance.player.transform.position, flyTime).SetEase(ease).OnComplete(()=> {
            GameManager.instance.player.GetComponent<PropsManager>().Pickup(this);
            Destroy(this.gameObject);
        }); ;
    }



}
